<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>

        window.onload = function () {
            setInterval(run, 100)
        }

        function run() {
            let colors = document.getElementsByClassName("radio");
            let getcolor = document.getElementById("color");
            let background = document.getElementById("d01");
            for (let i = 0; i < colors.length; i++) {
                if (colors[i].checked===true){
                    getcolor.value = colors[i].value
                    background.style.backgroundColor = colors[i].value;
                }
            }
        }

    </script>
</head>
<body>
<div id="d01" style="background-color: grey;width: 1000px;margin: auto">
    <div>
        <div style="margin: auto;width: 500px">
            颜色名称：<input type="text" id="color" value="">
            <br>
            颜色数值：<input type="text" value="">
        </div>
    </div>
    <br>
    <table border="1px" cellpadding="1px" style="margin: auto;width: 1000px;height: 50px">
        <tr>
            <td><input type="radio" name="col" class="radio" value="aliceblue">艾利斯兰</td>
            <td><input type="radio" name="col" class="radio" value="antiquewhite">古董白</td>
            <td><input type="radio" name="col" class="radio" value="aqua">浅绿色</td>
            <td><input type="radio" name="col" class="radio" value="aquamarine">碧绿色</td>
        </tr>
        <tr>
            <td><input type="radio" name="col" class="radio" value="skyblue">天蓝色</td>
            <td><input type="radio" name="col" class="radio" value="beige">米色</td>
            <td><input type="radio" name="col" class="radio" value="bisque">桔黄色</td>
            <td><input type="radio" name="col" class="radio" value="black">黑色</td>
        </tr>
    </table>
</div>
</body>
</html>